home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 06 - 1990 / 06.01 Jan 90 / DLL Source Code / SampAAA.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-27  |  1.4 KB  |  48 lines  |  [TEXT/MPS ]

  1. /************************************************/
  2. /*                  Sample DLL's                */
  3. /*       Copyright © Vincent Parsons 1989.      */
  4. /************************************************/
  5. /*    DLL code for MPW C 3.0 or THINK C 4.0     */
  6. /*       with Excel for the Macintosh 2.2       */
  7. /*             and Microsoft C 5.1              */
  8. /*          with Excel for Windows 2.1          */
  9. /************************************************/
  10. /* SampAAA is an example of two data type A     */
  11. /* inputs and one data type A output.  The      */
  12. /* output is the logical AND of the two inputs. */
  13. /************************************************/
  14. /*   =REGISTER("SampDLLs","SampAAA","AAA")      */
  15. /*   for both the Mac and the PC.               */
  16. /************************************************/
  17.  
  18. #include "DLL.h"
  19.  
  20. #if applec
  21. #include <Types.h>
  22.  
  23. #elif MSDOS
  24. #include <windows.h>
  25.  
  26. #endif
  27.  
  28. #if THINK_C
  29. pascal unsigned short main(unsigned short b1, unsigned short b2);    /* prototype */
  30.  
  31. pascal unsigned short main(b1, b2)
  32. unsigned short b1;
  33. unsigned short b2;
  34.  
  35. #elif applec
  36. pascal unsigned short SampAAA(unsigned short b1, unsigned short b2)
  37.  
  38. #elif MSDOS
  39. unsigned short far pascal SampAAA(unsigned short b1, unsigned short b2)
  40. #endif
  41. {
  42.     /* Returned parameter is the logical AND of the two inputs */
  43.     return (b1 & b2);
  44. }
  45.  
  46. /************************************************/
  47.  
  48.